<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>入库管理</title>
    <!-- 引入jquery -->
    <script src="/jquery2.2.3/jquery.min.js"></script>
    <!-- 引入layui -->
    <link rel="stylesheet" href="/layui-2.8.17/css/layui.css">
    <script src="/layui-2.8.17/layui.js"></script>
    <!--引入时间搜索框daterangepicker-->
    <script src="/daterangepicker-3.1/moment.min.js"></script>
    <script src="/daterangepicker-3.1/daterangepicker.js"></script>
    <link href="/daterangepicker-3.1/daterangepicker.css" rel="stylesheet">
    <!-- 引入bootstrap -->
    <link href="/bootstrap-3.4.1/css/bootstrap.css" rel="stylesheet">
    <script src="../bootstrap-3.4.1/js/bootstrap.js"></script>
    <!--引入bootstra-table-->
    <script src="/bootstrap-table-1.11.1/bootstrap-table.js"></script>
    <link href="/bootstrap-table-1.11.1/bootstrap-table.css" rel="stylesheet">
    <!-- 引入bootstra-table中文语言包 -->
    <script src="/bootstrap-table-1.11.1/locale/bootstrap-table-zh-CN.js"></script>
</head>
<body>
<div class="container-fluid">
    <!--搜索框-->
    <div class="top-toolbar" id="top-toolbar">
        <div class="form-group">
            <label class="col-sm-2 control-label" for="search-goodsName">商品名称</label>
            <div class="col-sm-4">
                <input class="form-control well" id="search-goodsName" name="search-goodsName" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="search-supplierName">供应商名称</label>
            <div class="col-sm-4">
                <input class="form-control well" id="search-supplierName" name="search-supplierName" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="search-no">入库编号</label>
            <div class="col-sm-4">
                <input class="form-control well" id="search-no" name="search-no" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="search-startAndEndTime">入库时间</label>
            <div class="col-sm-4">
                <input class="form-control well" id="search-startAndEndTime" name="search-startAndEndTime" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <button class="btn btn-primary" id="searchInbound" onclick="searchInboundOnClick()">查询</button>
            <button type="button" id="reset" class="btn btn-default">重置</button>
            <button class="btn btn-info" data-target="#addModal" data-toggle="modal">新增</button>
        </div>

    </div>
    <br>
    <!--  定义添加模态框触发器，此处为按钮触发  -->
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="addModal" role="dialog" tabindex="-1">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->
                <div class="btn-info modal-header">
                    <!--  模态框标题  -->
                    <button class="close" data-dismiss="modal" type="button">&times;</button>
                    <!--  关闭按钮  -->
                    <h4>新增入库</h4>
                    <!--  标题内容  -->
                </div>

                <div class="modal-body">
                    <div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="add-all-supplierId">供应商id</label>
                            <div class="col-sm-9">
                                <input id="add-all-supplierId" name="add-all-supplierId" type="text"
                                       class="form-control well" disabled/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="add-all-supplierName">供应商名称</label>
                            <div class="col-sm-9">
                                <input autocomplete="off" class="form-control well dropdown-menu-input"
                                       id="add-all-supplierName"
                                       name="add-all-supplierName" type="text"/>
                                <ul class="dropdown-menu pre-scrollable" id="all-add-supplier-dropdown-menu"></ul>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="add-all-note">备注</label>
                            <div class="col-sm-9">
                                <input class="form-control well" id="add-all-note" name="add-all-note" type="text"/>
                            </div>
                        </div>
                    </div>
                    <br>
                    <div id="addTrDiv" style="margin-top:30px; width: 15%; float: right;">
                        <button class="btn btn-info" onclick="addTr()" type="button">添加一行</button>
                    </div>
                    <table class="table table-bordered" id="addGoodsTable">
                        <thead>
                        <tr>
                            <th style="text-align:center">商品id</th>
                            <th style="text-align:center">商品名称</th>
                            <th style="text-align:center">盒装数量</th>
                            <th style="text-align:center">散装数量</th>
                            <th style="text-align:center">规格</th>
                            <th style="text-align:center">供应商id</th>
                            <th style="text-align:center">供应商名称</th>
                            <th style="text-align:center">入库成本</th>
                            <th style="text-align:center">备注</th>
                            <th style="text-align:center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <!--商品id-->
                            <td disabled style="text-align:center" name="goodsId"></td>
                            <!--商品名称-->
                            <td autocomplete="off" onclick="tdClick(this)" style="text-align:center"
                                name="goodsName"></td>
                            <!--盒装数量-->
                            <td onclick="tdClick(this)" style="text-align:center" name="boxNum"
                                oninput="boxNumInput(this)"></td>
                            <!--数量-->
                            <td onclick="tdClick(this)" style="text-align:center" name="num"
                                oninput="numInput(this)"></td>
                            <!--规格-->
                            <td disabled onclick="tdClick(this)" style="text-align:center" name="perBox"></td>
                            <!--供应商id-->
                            <td disabled style="text-align:center" name="supplierId"></td>
                            <!--供应商名称-->
                            <td autocomplete="off" onclick="tdClick(this)" style="text-align:center"
                                name="supplierName"></td>
                            <!--入库成本-->
                            <td onclick="tdClick(this)" style="text-align:center" name="priceCent" c></td>
                            <!--备注-->
                            <td onclick="tdClick(this)" style="text-align:center" name="note"></td>
                            <!--操作-->
                            <td onclick="trDelete(this)" style="text-align:center; ">
                                <button class="btn btn-xs btn-link" type="button">删除</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button class="btn btn-info" id="addInbound" type="button">新增</button>
                    <button class="btn btn-default" data-dismiss="modal" type="button">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#addModal -->
    <!--  定义修改模态框触发器，此处为按钮触发  -->
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="updateModal" role="dialog"
         tabindex="-1">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->
                <div class="btn-info modal-header">
                    <!--  关闭按钮  -->
                    <button class="close" data-dismiss="modal" type="button">&times;</button>
                    <!--  标题内容  -->
                    <h4>修改入库</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-id">入库id</label>
                        <div class="col-sm-9">
                            <input id="update-id" name="update-id" type="text" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-no">入库编号</label>
                        <div class="col-sm-9">
                            <input id="update-no" name="update-no" type="text" class="form-control well"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-goodsId">商品id</label>
                        <div class="col-sm-9">
                            <input id="update-goodsId" name="update-goodsId" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-goodsName">商品名称</label>
                        <div class="col-sm-9">
                            <input id="update-goodsName" name="update-goodsName" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-boxNum">入库盒装数量</label>
                        <div class="col-sm-9">
                            <input class="form-control well" id="update-boxNum" name="update-boxNum" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-perBox">商品规格</label>
                        <div class="col-sm-9">
                            <input class="form-control well" id="update-perBox" name="update-perBox" type="text"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-num">入库数量</label>
                        <div class="col-sm-9">
                            <input class="form-control well" id="update-num" name="update-num" type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-priceYuan">入库成本：元</label>
                        <div class="col-sm-9">
                            <input class="form-control well" id="update-priceYuan" name="update-priceYuan"
                                   type="text"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-supplierId">供应商id</label>
                        <div class="col-sm-9">
                            <input id="update-supplierId" name="update-supplierId" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-supplierName">供应商名称</label>
                        <div class="col-sm-9">
                            <input autocomplete="off" class="form-control well dropdown-menu-input"
                                   id="update-supplierName"
                                   name="update-supplierName" type="text"/>
                            <ul class="dropdown-menu pre-scrollable" id="update-supplier-dropdown-menu"></ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="update-note">备注</label>
                        <div class="col-sm-9">
                            <input class="form-control well" id="update-note" name="update-note" type="text"/>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button class="btn btn-info" id="updateInbound" type="button">修改</button>
                    <button class="btn btn-default" data-dismiss="modal" type="button">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#updateModal -->
    <!--  定义删除模态框触发器，此处为按钮触发  -->
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="deleteModal" role="dialog"
         tabindex="-1">
        <!--  定义模态框，过渡效果为淡入，id为myModal,tabindex=-1可以禁用使用tab切换，aria-labelledby用于引用模态框的标题，aria-hidden=true保持模态框在触发前窗口不可见  -->
        <div class="modal-dialog">
            <!--  显示模态框对话框模型（若不写下一个div则没有颜色）  -->
            <div class="modal-content">
                <!--  显示模态框白色背景，所有内容都写在这个div里面  -->

                <div class="btn-info modal-header">
                    <!--  模态框标题  -->
                    <button class="close" data-dismiss="modal" type="button">&times;</button>
                    <!--  关闭按钮  -->
                    <h4>删除入库</h4>
                    <!--  标题内容  -->
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-id">入库id</label>
                        <div class="col-sm-9">
                            <input id="delete-id" name="delete-id" type="text" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-no">入库编号</label>
                        <div class="col-sm-9">
                            <input id="delete-no" name="delete-no" type="text" class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-goodsId">商品id</label>
                        <div class="col-sm-9">
                            <input id="delete-goodsId" name="delete-goodsId" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-goodsName">商品名称</label>
                        <div class="col-sm-9">
                            <input id="delete-goodsName" name="delete-goodsName" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-supplierId">供应商id</label>
                        <div class="col-sm-9">
                            <input id="delete-supplierId" name="delete-supplierId" type="text" class="form-control well"
                                   disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-supplierName">供应商名称</label>
                        <div class="col-sm-9">
                            <input id="delete-supplierName" name="delete-supplierName" type="text"
                                   class="form-control well" disabled/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="delete-note">备注</label>
                        <div class="col-sm-9">
                            <input id="delete-note" name="delete-note" type="text" class="form-control well" disabled/>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <!--  模态框底部样式，一般是提交或者确定按钮 -->
                    <button class="btn btn-danger" id="deleteInbound" type="button">删除</button>
                    <button class="btn btn-info" data-dismiss="modal" type="button">取消</button>
                </div>

            </div><!-- /.modal-content -->
        </div>
    </div> <!-- /#deleteModal -->

    <table class="table table-bordered" id="inbound"></table>
</div>

<script src="/js/inbound.js"></script>
</body>
</html>